FROM harbor.admxj.cn/library/openjdk:8-jdk

COPY target/dubbo-demo-1.0-SNAPSHOT-assembly.tar.gz /opt/dubbo-demo-assembly.tar.gz

RUN mkdir -p /opt/dubbo-demo && \
    tar -zxvf /opt/dubbo-demo-assembly.tar.gz -C /opt/dubbo-demo && \
    chmod +x /opt/dubbo-demo/bin/start.sh && \
    sed -i "s/\r//" /opt/dubbo-demo/bin/start.sh && \
    sed -i "s/\r//" /opt/dubbo-demo/bin/stop.sh && \
    rm -rf /opt/dubbo-demo-assembly.tar.gz

ENTRYPOINT ["/opt/dubbo-demo/bin/start.sh"]